<extend name="Shops:layout" />
<block name="content">
<style type="text/css">
#preview{border:1px solid #cccccc; background:#CCC;color:#fff; padding:5px; display:none; position:absolute;}
</style>
<!--时间日历插件-->
<script type="text/javascript" src="__PUBLIC__/plugins/jeDate/jedate.js"></script>
<script>
$(document).ready(function(){
    $('.imgPreview').imagePreview();
    <notempty name='shopCatId1'>
    getShopCatListForGoods('{$shopCatId1}','{$shopCatId2}');
    </notempty>
});
</script>
<script>
    function staffDelete(id,shopId)
    {
        layer.confirm("您确定要删除该投诉吗？",{icon: 3, title:'系统提示'},function(tips){
          var ll = layer.load('数据处理中，请稍候...');
          $.post(Think.U('Home/Complain/delete'),{id:id,shopId:shopId},function(data,textStatus){
            layer.close(ll);
              layer.close(tips);
            var json = WST.toJson(data);
            if(json.status=='1'){
              WST.msg('操作成功!', {icon: 1}, function(){
                 location.reload();
              });
            }else{
              WST.msg('操作失败!', {icon: 5});
            }
          });
      });
    }
</script>
        <div class="wst-body" style="margin-bottom: 8px;">
        <div class='wst-page-header'>卖家中心 > 投诉信息</div>
        <div class='wst-page-content'>
            
            <div id='tab' class="wst-tab-box">
                <div class='wst-tbar-query'>
                  <form method="post" action="{:U('Home/Complain/index')}">
                订单号:<input type='text' name='orderNo' value='' style="color:gray;"/>
                开始时间:<input class="datainp" id="startTime" name="startTime" type="text" placeholder="请选择" 
          value='{$startTime}'  readonly>
        结束时间:<input class="datainp" id="endTime" name="endTime" type="text" placeholder="请选择" value='{$endTime}'  readonly>
        <!--
        处理状态：
                    <select name="isHandle" style="margin-right: 20px;">
                        <option value='-1' 
                            <if condition="$data.isHandle == -1 ">selected</if>
                            >全部
                        </option>
                        <option value='0'
                            <if condition="$data.isHandle == 0">selected</if>
                            >未处理
                        </option>
                        <option value='1'
                            <if condition="$data.isHandle == 1 ">selected</if>
                            >已处理
                        </option>
                    </select>
                    -->
                <button style="border:1px solid #ffffff;height:30px;width:60px;background-color:#e23e3d;color:#ffffff;cursor: pointer;" >查询</button>
                </form>
                </div>
              <div class="wst-tab-content" style='width:98%;'>
                    <!-- 待受理 -->
                    <div class='wst-tab-item'>
                        <div>
                            <if condition="$data['error'] eq ''">
                            <table class='wst-list' style="font-size:13px;">
                                <thead>
                                <tr>
                                    <th width='60'>序号</th>
                                    <th width='100'>订单号</th>
                                    <th width='90'>手机号码</th>
                                    <th width='300'>投诉内容</th>
                                    <th width='130'>投诉时间</th>
                                    <th width='100'>操作</th>
                                </tr>
                                
                                </thead>
                                <tbody id="otbody0">
                                <volist name="data['root']" id="vo" key="i">
                                    <tr>
                                        <td >{$i}</td>
                                        <td >{$vo.orderNo}</td>
                                        <td >{$vo.phone}</td>
                                        <td>{$vo.content}</td>
                                        <td >
                                            <php>
                                                echo date('Y-m-d H:i:s',$vo['time']);
                                            </php>
                                        </td>
                                        
                                        <td ><a href='javascript:;' onclick=showOrder("{$vo.orderId}")>查看</a>
                                        &nbsp;&nbsp;<a href="javascript:void(0)" onclick="staffDelete({$vo['id']},{$vo.shopId})" class="staff_del">删除</a></td>
                                    </tr>
                                </volist>
                               
                                </tbody>
                                 <tfoot>
             <tr>
                <td colspan='12' align='center'>
                <div class="wst-page" style="float:right;padding-bottom:10px;">
            <div id="wst-page-items"></div>
        </div>
                <script>
          <if condition="$data['totalPage'] gt 1">
          $(document).ready(function(){
          laypage({
              cont: 'wst-page-items',
              pages: {$data['totalPage']}, //总页数
              skip: true, //是否开启跳页
              skin: '#e23e3d',
              groups: 3, //连续显示分页数
              curr: function(){ //通过url获取当前页，也可以同上（pages）方式获取
                  var page = location.search.match(/p=(\d+)/);
                  return page ? page[1] : 1;
              }(), 
              jump: function(e, first){ //触发分页后的回调
                  if(!first){ //一定要加此判断，否则初始时会无限刷新
                    var nuewurl = WST.splitURL("p");
                    var ulist = nuewurl.split("?");
                    if(ulist.length>1){
                      location.href = nuewurl+'&p='+e.curr;
                    }else{
                      location.href = '?p='+e.curr;
                    }
                      
                  }
              }
          });
          });
        </if>
        </script>
                </td>
             </tr>
             </tfoot>
                            </table>
                            <else />
                                {$data['error']}
                            </if>
                        </div>
                        <div style='clear:both;'></div>
                    </div>
                </div>
            </div>
        </div>
        <div style='clear:both;'></div>
    </div>
<script type="text/javascript">
    jeDate({
    dateCell:"#startTime",
    format:"YYYY-MM-DD hh:mm:ss",
    isinitVal:false,
    isTime:true, //isClear:false,
    minDate:"2014-09-19 00:00:00",
    okfun:function(val){}
  })
    jeDate({
    dateCell:"#endTime",
    format:"YYYY-MM-DD hh:mm:ss",
    isinitVal:false,
    isTime:true, //isClear:false,
    minDate:"2014-09-19 00:00:00",
    okfun:function(val){}
  })
</script>
</block> 